package com.ylx.web.p;

import com.ylx.pojo.Order;
import com.ylx.service.OrderService;
import com.ylx.service.OrderServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/queDingOrderServlet")
public class QueDingOrderServlet extends HttpServlet {
    protected void doGet (HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");

        String oid = request.getParameter("oid");
        String name = request.getParameter("name");
        String tel= request.getParameter("telephone");
        Order order=new Order();
        order.setOid(oid);
        order.setNAME(name);
        order.setTel(tel);
        OrderService orderService=new OrderServiceImpl();
//        orderService.update(order);

        order= orderService.selectByOid(oid);


        request.setAttribute("order",order);

        request.getRequestDispatcher("front/account.jsp").forward(request, response);




    }

    protected void doPost (HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        this.doGet(request, response);

    }
}
